<?php

require_once dirname(__FILE__).'/../lib/auditoria_entidadGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/auditoria_entidadGeneratorHelper.class.php';

/**
 * auditoria_entidad actions.
 *
 * @package    sistema_estadisticas
 * @subpackage auditoria_entidad
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class auditoria_entidadActions extends autoAuditoria_entidadActions
{

	public function executeHistorial(sfWebRequest $request)
	{
		$table = AuditoriaEntidadTable::getInstance();
		
		$this->auditoria_entidad = $table->find($request->getParameter('id'));
		$this->forward404Unless($this->auditoria_entidad);

		$this->pager = $this->configuration->getPager($table->getVersionClassName($this->auditoria_entidad->getEntidad()));

		$query = $table->getHistorialQuery($this->auditoria_entidad->getEntidad());

		$this->pager->setQuery($query);

		if ($request->hasParameter('page'))
			$this->pager->setPage($request->getParameter('page'));
		else
			$this->pager->setPage(0);

		$this->pager->init();
	}

}
